<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表页</title>
    <!--<link rel="stylesheet" href="src/css/pagination.css">-->
    <link rel="stylesheet" href="src/css/list.css">
    <script src="src/js/jquery-1.11.3.min.js"></script>
    <script src="src/js/jquery.pagination.js"></script>
    <script src="src/js/list.js"></script>
</head>
<body>
    <div class="list-wrap">
        <div class="banxin">
            <div class="list-header">
                <img src="src/images/mark.png" alt="" class="list-header-mark">
                <span class="list-header-title">首页</span>
                <span>&gt;</span>
                <span class="list-header-title">工作动态</span>
                <span>&gt;</span>
                <span class="list-header-active">新政策</span>
            </div>
            <div class="list-content">
                <div class="list-content-nav">
                    <div class="list-content-nav-item">新政策</div>
                </div>
                <div class="list-content-table">
                    <div class="list-content-table-tr">
                        <div class="icon"><img src="src/images/list.png" alt=""></div>
                        <div class="content">国家税务总局北京市税务局关于原北京市国家税务局2018年度新录用公务员报到的通知 </div>
                        <div class="line">|</div>
                        <div class="time">2018-09-08</div>
                    </div>
                    <div class="list-content-table-tr">
                        <div class="icon"><img src="src/images/list.png" alt=""></div>
                        <div class="content">国家税务总局北京市税务局关于原北京市国家税务局2018年度新录用公务员报到的通知 </div>
                        <div class="line">|</div>
                        <div class="time">2018-09-08</div>
                    </div>
                </div>
                <!--分页-->
                <div class="list-content-pagination pagination">

                </div>
            </div>
        </div>
    </div>

<script >
    $(function () {
      $('.list-content-pagination').pagination({
        coping: true,
        homePage: '首页',
        endPage: '末页',
        prevContent: '上页',
        nextContent: '下页',
        pageCount: 9,
        jump: true,
        keepShowPN: true,
        callback: function (api) {
          initFristEndPageClass()
          console.log(api.getCurrent())
        }
      });
      initFristEndPageClass()
      // 给首末页加样式
      function initFristEndPageClass () {
        var shouye = $('.list-content-pagination .prev').next().text()
        var moye = $('.list-content-pagination .next').prev().text()
        if (shouye === '首页') {
          $('.list-content-pagination .prev').next().addClass('firstPage')
        }
        if (moye === '末页') {
          $('.list-content-pagination .next').prev().addClass('endPage')
        }
      }

    })
</script>
</body>
</html>